#ifndef _UTIL_
#define _UTIL_

#include <string>
#include <vector>
#include "ValueType.h"
#include "tree/BinaryOperationType.h"
#include "tree/FunctionDefinition.h"
#include "tree/UnaryOperationType.h"
#include "BuiltInFunctionType.h"

using namespace std;

class Util
{
public:
    static string Number2String(int iValue);
    static string ValueType2String(ValueType iType);
    static string BinaryOp2String(BinaryOperationType iOp);
    static string UnaryOp2String(UnaryOperationType iOp);
    static string BuiltInFunctionType2String(BuiltInFunctionType iFn);

    // Prijme pole bytu (string) o delce 4 a vyrobi z toho int.
    // Byty jsou zapsane v Little-endian zapisu.
    static int LEBytes2Int(string iBytes);

    // Pro zadanou hodnotu bytu vrati odpovidajici bool hodnotu.
    // Pokud je iByte == 0, vrati false, jinak true.
    static bool Byte2Bool(char iByte);

    // Prevede int na pole bytu v little-endian zapisu.
    static vector<char> Int2LittleEndian(int iValue);

    static FunctionDefinition* BuildPredefinedFunction(string iName, unsigned int iParamCount);
};

#endif
